<?php
/**
 * Created by PhpStorm.
 * User: zhang-hong
 * Date: 2017/4/11
 * Time: 13:50
 */
class GetbingfanglishijsonController extends Yaf_Controller_Abstract
{

    function IndexAction()
    {
        $request = $this->getRequest();
        $bingqu = $request->getPost("bingqu","");
        $bingfanghao = $request->getPost("bingfanghao","");
        $yiyuan_id = $request->getPost("yiyuan_id","");

       // $bingfanghao = $_REQUEST["bingfanghao"];

        date_default_timezone_set("Asia/Shanghai");
        $today = date("Y-m-d");
        $bingfang_result = DB::select('id,zhixing_id,bingqu,state,modify_time,bingfanghao,user_number')
            ->from("data_bingfang_xuncha_histroy")
            ->where("bingqu",'=',$bingqu)
            ->and_where("bingfanghao","=",$bingfanghao)
            ->and_where("date(modify_time)","=",$today)
            ->and_where("yiyuan_id","=",$yiyuan_id)
            ->order_by("modify_time","DESC")
            ->limit(1)
            ->execute()
            ->as_array();
        $async_result["result"]= $bingfang_result;
        $async_result["state"] = "1";
        $async_result["staus_info"] = "数据同步成功:)";
        $async_result["error"] = 200;
        $async_result["msg"] = "";
        Utility::apiJsonResultExtends($async_result);
    }
}